package selef.xiafan.entity.user;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @Entity: this is an entity
 * @Table: Corresponding table name
 * */
@Data
@Entity
@ToString
@Table(name = "t_user")
@JsonIgnoreProperties({"handler","hibernateLazyInitializer"})
public class User implements Serializable {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    private Integer id;

    private String username; // 昵称，用在登录，注册，展示

    private String realName; // 用户真实姓名

    private String phone; // 电话

    private String password; // 密码

    private String gender; // 性别

    private String email; // 邮箱

    private Boolean enable; // 是否启用

    private String salt; // 加盐

    private String createBy; // 被谁创建

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @Column(name="is_sys")
    private Boolean isSys;

}
